<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>

<!DOCTYPE html>
<f:view locale="#{languageBean.locale}">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title><h:outputText value="#{msg.pagina_principale} #{patientBean.nome} - #{patientBean.cognome}" /></title>
            <link href="<% out.print(request.getContextPath());%>/resources/css/position.css" rel="stylesheet" type="text/css" />
            <script src="/PortaleVisite/resources/js/jquery-1.7.1.min.js" ></script>
        </head>
        <body>

            <jsp:include page="/pages/fragments/header.jsp" />


            <jsp:include page="/pages/fragments/patientMenu.jsp" />

            <section>
                <h:form >
                    <rich:panel >
                        <a4j:outputPanel >
                            <rich:dataTable value="#{examinationBean.patientOldExaminations}" var="visita" id="tab">

                                <f:facet name="header">
                                    <h:outputText value="#{msg.lista_yet_done}"/>
                                </f:facet>

                                <rich:column sortBy="#{visita.scadenza}" >
                                    <f:facet name="header">
                                        <h:outputText value="#{msg.data_yet_done}"/>
                                    </f:facet>
                                    <h:outputText value="#{visita.scadenza}" id="date">
                                        <f:convertDateTime pattern="#{msg.date_pattern}"  />
                                    </h:outputText>
                                </rich:column>

                                <rich:column sortBy="#{visita.effettuata}">
                                    <f:facet name="header">
                                        <h:outputText value="#{msg.effettuata_yet_done}"/>
                                    </f:facet>
                                    <h:outputText value="#{visita.effettuata}" rendered="#{visita.effettuata}" style="color: green" />
                                    <h:outputText value="#{visita.effettuata}" rendered="#{!visita.effettuata}" style="color: red" />
                                </rich:column>

                                <rich:column sortBy="#{visita.tipo_scadenza}">
                                    <f:facet name="header">
                                        <h:outputText value="#{msg.tipo_yet_done}"/>
                                    </f:facet>
                                    <h:outputText value="#{msg.prog_exam}" rendered="#{visita.tipo == 1}" />
                                    <h:outputText value="#{msg.vaccination}" rendered="#{visita.tipo == 2}" />
                                    <h:outputText value="#{msg.voluntary}" rendered="#{visita.tipo == 3}" />
                                </rich:column>

                                <rich:column sortBy="#{visita.descrizione}" >
                                    <f:facet name="header">
                                        <h:outputText value="#{msg.descrizione_yet_done}"/>
                                    </f:facet>
                                    <h:outputText value="#{visita.descrizione}" >

                                    </h:outputText>
                                </rich:column>
                            </rich:dataTable>
                        </a4j:outputPanel>
                    </rich:panel>

                </h:form>
            </section>
            
        </body>
    </html>
</f:view>